package com.zht.controller;

import com.zht.enums.DrinkType;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


@RestController
@RequestMapping("/drink")
public class DrinkController {
    @GetMapping("/{type}")
    public String drink(@PathVariable DrinkType type){
        return "您选择的是：" + type.getLabel() + "该饮料的价格为：" + type.getPrice();
    }

}
